
package com.zealfi.zxb.api.common;

/**
 * Created by kuan at 2016-07-18 下午 1:09
 */
public enum Status {
    FAILED(-1, "请求失败"),
    SERVER_ERROR(-2, "服务端异常"),
    GET_IMAGE_FAILED(-3, "获取图片失败"),
    GET_HEAD_IMAGE_FAILED(-3, "获取用户头像失败"),
    AUTH_ERROR(-4, "认证失败,拒绝访问"),
    INVALID_TOPIC(-5, "无效的topic"),

    OK(0, "OK"),
    DISABLE(0, "不可用"),
    ENABLE(1, "可用"),

    FILE_NOT_EXIST(6, "文件不存在"),
    FILE_TOO_LARGE(7, "文件过大"),
    FILE_TYPE_ERROR(8, "上传文件类型错误"),
    FILE_ALREADY_UPLOAD(9, "头像已上传"),

    DATA_NOT_EXIST(11, "数据不存在"),
    REACH_UPPER_LIMIT(12, "达到次数上线"),

    ACCOUNT_OR_PASSWORD_ERROR(1000, "登录密码输入错误"),
    INVALID_TOKEN(1001, "您的登录已超时,请重新登录"),
    ACCOUNT_OR_PASSWORD_EMPTY(1002, "账号和密码不匹配"),
    MOBILE_ALREADY_EXIST(1003, "该手机号已存在"),
    MOBILE_CAN_NOT_BE_USE(1004, "手机号码已注册"),
    MOBILE_NOT_EXIST(1005, "手机号码未注册"),
    OLD_PASSWORD_DISACCORD(1006, "旧密码输入错误"),
    LOGIN_FAILED_UPPER_BOUND(1007, "密码错误次数超过限制，请明天再试"),
    INVALID_PASSWORD(1008, "请输入6-12位密码"),
    THE_SAME_PASSWORD(1009, "新旧密码相同", "新密码不能与旧密码相同"),
    BE_KILLED_TOKEN(1010, "您的帐号刚刚在别处登录了，请检查帐号是否被盗用"),
    SAVE_CUST_INFO_FAIL(1011, "保存用户个人信息失败"),
    NOT_MOBILE_NUMBER(1012, "手机号码有误，请重新输入"),
    COLLECT_CUST_INFO_IS_NULL(1013, "用户信息为空,保存失败"),
    ACCOUNT_STATUS_DISABLE(1014, "无效的帐号", "您的账号已禁止登录，请联系客服"),
    ACCOUNT_STATUS_BLACK_LIST(1015, "此帐号在黑名单中", "您的账号已禁止登录，请联系客服"),
    ACCOUNT_STATUS_LOCKED(1016, "被锁定的帐号", "您的账号已禁止登录，请联系客服"),
    DEVICE_ALREADY_EXIST(1017, "设备已存在", "该手机已注册，请换个手机"),
    DEVICE_IS_EMPTY(1018, "设备号为空", "很抱歉，本软件需要获取设备信息权限。"),
    DEVICE_NOT_EXIST(1019, "设备号不存在", "服务器开小差了，稍后再试"),
    DOWNLOAD_LINK_ERROR(1020, "无效的链接地址"),
    HAS_SIGNED_IN(1021, "今天已经签过到了"),
    CHANNEL_ID_IS_EMPTY(1022, "渠道号为空", "渠道号为空"),
    GROUP_ID_IS_EMPTY(1022, "机构号为空", "机构号为空"),

    VERIFY_CODE_ERROR(1100, "验证码有误，请重新输入"),
    VERIFY_CODE_EXPIRATION(1101, "验证码已过期，请重新输入"),
    VERIFY_CODE_UPPER_BOUND(1102, "您获取验证码次数超过限制，请明天再试"),
    VERIFY_CODE_SEND_FAILED(1103, "短信验证码发送失败", "服务器开小差了，稍后再试"),
    IMG_VERIFY_CODE_ERROR(1104, "图片验证码错误"),
    VERIFY_CODE_TYPE_ERROR(1105, "验证码类型错误"),

    INVALID_NATION(1200,"民族名称错误"),
    INVALID_REAL_NAME(1201,"姓名不正确"),
    INVALID_ID_CARD_NO(1202,"身份证格式错误"),
    CAN_NOT_RESUBMIT(1203,"不能重复提交"),
    INSUFFICIENT_INFO(1204,"资料不全，无法提交"),
    EMPTY_URL(1205,"url不能为空"),
    EMPTY_DATA(1206,"信息不存在"),
    NO_REAL_NAME_DATA(1207,"没有找到实名认证信息"),
    NO_CUST_INFO_DATA(1208,"没有找到个人信息"),
    REAL_NAME_FAILED(1209,"实名认证失败"),
    REAL_NAME_UPPER_BOUND(1210,"当日实名认证次数超过3次"),

    //短信相关
    SEND_SMS_OK(0, "发送短信成功"),
    SEND_SMS_TIMEOUT(2001, "发送短信超时", "服务器开小差了，稍后再试"),
    SEND_SMS_FAILED(2002, "发送短信失败"),
    SEND_SMS_BAD_PARAM(2003, "发送短信参数错误", "服务器开小差了，稍后再试"),
    SEND_SMS_SERVICE_ERROR(2004, "发送短信系统异常", "服务器开小差了，稍后再试");

    private Integer code; // 状态码
    private String message; // 后台显示信息
    private String uiMessage; // 前端显示信息

    Status(Integer code, String message, String uiMessage) {
        this.code = code;
        this.message = message;
        this.uiMessage = uiMessage;
    }

    Status(Integer code, String message) {
        this.code = code;
        this.message = message;
        this.uiMessage = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public String getUiMessage() {
        return uiMessage;
    }
}
